From: Boris Ostrovsky Date: Mon, 22 Jun 2015 15:52:13 +0000 (+0200) Subject: x86/pvh: don't copy to/from trap_ctxt for 32b PVH guests X-Git-Tag: archive/raspbian/4.8.0-1+rpi1~1^2~3055 X-Git-Url: https://dgit.raspbian.org/%22http:/www.example.com/cgi/%22https:/%22bookmarks://%22Dat/%22http:/www.example.com/cgi/%22https:/%22bookmarks:/%22Dat?a=commitdiff_plain;h=57647ee9ccfd0d40c9af8fa0a1787cca182451ec;p=xen.git x86/pvh: don't copy to/from trap_ctxt for 32b PVH guests .. as this field is not used by PVH guests Signed-off-by: Boris Ostrovsky Reviewed-by: Jan Beulich --- diff --git a/xen/arch/x86/domain.c b/xen/arch/x86/domain.c index e396c6cffc..c7ef1e6aaa 100644 --- a/xen/arch/x86/domain.c +++ b/xen/arch/x86/domain.c @@ -805,9 +805,12 @@ int arch_set_info_guest( else { XLAT_cpu_user_regs(&v->arch.user_regs, &c.cmp->user_regs); - for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i ) - XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i, - c.cmp->trap_ctxt + i); + if ( is_pv_domain(d) ) + { + for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i ) + XLAT_trap_info(v->arch.pv_vcpu.trap_ctxt + i, + c.cmp->trap_ctxt + i); + } } if ( has_hvm_container_domain(d) ) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index d8ffe2b80e..82bd8186b4 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1204,9 +1204,12 @@ void arch_get_info_guest(struct vcpu *v, vcpu_guest_context_u c) else { XLAT_cpu_user_regs(&c.cmp->user_regs, &v->arch.user_regs); - for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i ) - XLAT_trap_info(c.cmp->trap_ctxt + i, - v->arch.pv_vcpu.trap_ctxt + i); + if ( is_pv_domain(d) ) + { + for ( i = 0; i < ARRAY_SIZE(c.cmp->trap_ctxt); ++i ) + XLAT_trap_info(c.cmp->trap_ctxt + i, + v->arch.pv_vcpu.trap_ctxt + i); + } } for ( i = 0; i < ARRAY_SIZE(v->arch.debugreg); ++i )